{extend name="layout"}
{block name="title"}编辑增员{/block}
{block name="body"}
<div class="content">
    <form class="mainForm" data-auto="false"  data-callback="submitCallback">
        <div class="error-info">

            <p><span class="iconfont icon-gantanhao-quan"></span> {$increase_insurance.feedback|default=""}</p>
        </div>
        <div class="item-box">
            <div class="item-title">
                员工信息
            </div>
            <div class="item-form">
                <div class="item-row">
                    <span class="label-required-prev">员工姓名：</span>
                    <div>
                        <input type="text" name="name" required placeholder="请输入姓名" autocomplete="off" value="{$increase.name|default=''}" disabled>
                    </div>
                </div>
                <div class="item-row">
                    <span>身份证号：</span>
                    <div>
                        <input type="text" name="id_number" required placeholder="请输入身份证号" autocomplete="off" value="{$increase.id_number|default=''}" disabled>
                    </div>
                </div>
                <div class="item-row">
                    <span>电话号码：</span>
                    <div>
                        <input type="number" name="mobile" required placeholder="请输入电话号码" autocomplete="off"   value="{$increase.mobile|default=''}" disabled>
                    </div>
                </div>


            </div>
        </div>
        <div class="item-box insurance_type">
            <div class="item-title">
                保险信息
            </div>
            <div class="item-form insurance-box" >
                <div class="item-row">
                    <span class="label-required-prev">保险类型：</span>
                    <div>
                        <input type="text"  disabled autocomplete="off"
                               value="{$insurances[$increase_insurance.insurance]}">
                    </div>
                </div>

            <div class="item-row">
                <span class="label-required-prev">起始日期：</span>
                <div>
                    <input readonly class="startDate" data-date-input=""   name="start_date" placeholder="请选择"  value="{$increase_insurance.start_date|default=''}" required>
                </div>
            </div>
            <div class="item-row">
                <span class="label-required-prev">所属账期：</span>
                <div>

                    <input   data-date-input="month" readonly  name="account_period" value="{$increase_insurance.account_period ? $increase_insurance.account_period|default='' : $nextmonth}" required>
                </div>
            </div>
            <div class="item-row">
                <span class="label-required-prev">社保工资：</span>
                <div>
                    <input type="number" name="wage" value="{$increase_insurance.wage|default=''}" required>
                </div>
            </div>
                <div class="item-row">
                <span class="label-required-prev">公司基数：</span>
                <div>
                    <input type="text" name="company_base" readonly value='{$increase_insurance.company_base|default="0.00"}' required>

                </div>
            </div>
            <div class="item-row">
                <span class="label-required-prev">个人基数：</span>
                <div>
                    <input type="text" name="personal_base" readonly value='{$increase_insurance.personal_base|default="0.00"}' required>
                </div>
            </div>

        </div>
        </div>





        <div class="button-box">
            <input type='hidden' value='{$increase_insurance.id}' name='id'>
            <input type='hidden' value='{$increase_insurance.insurance}' name='insurance'>
            <a class="add-updata" onclick="$('form').submit()">提交审核</a>

        </div>
</form>

</div>


{/block}
{block name="script"}
<!--<script>-->
<!--	$(function (){-->
<!--		var docmHeight= document.documentElement.clientHeight ||document.body.clientHeight,-->
<!--			showHeight= document.documentElement.clientHeight ||document.body.clientHeight-->
<!--		// var Height = $('body').height();-->
<!--		// console.log(docmHeight -80,showHeight)-->
<!--		// 回到顶部-->
<!--		$(window).resize(function () {-->
<!--			// 回到顶部-->
<!--			showHeight= document.documentElement.clientHeight ||document.body.clientHeight-->
<!--			// console.log(showHeight)-->
<!--			if((docmHeight - 100)> showHeight){-->
<!--				//隐藏-->
<!--				$(".button-box").hide()-->
<!--			}else{-->
<!--				//显示-->
<!--				$(".button-box").show()-->
<!--			}-->
<!--		});-->
<!--	})-->
<!--</script>-->
<script>
	$(function () {
		// $(".startDate").calendar({dateFormat: 'yyyy-mm-dd',});

		$("[name='wage']").change(function(){
			let wage=$(this).val() ,insurance=$("[name='insurance']").val();
			console.log(wage,insurance)
			$.form.load('{:url("index/incconfig/insuranceBase")}', {wage,insurance}, "post", function (ret) {
				if (ret.code === 1) {
					$("[name='company_base']").val(ret.data.company);
					$("[name='personal_base']").val(ret.data.personal)

				} else {
					$.msg.error(ret.info, 1)
				}


				return false;
			})
		})

	})
</script>
<script>








</script>

{/block}
{block name="style"}
<style>
    .layui-table tbody tr:hover{
        background-color: #fff;
    }
</style>
{/block}


